#pragma once
#include "UIBase.h"

enum TeamStatusPanel
{
	MY_TEAM,			// 我的队伍界面
	NEARBY_MAN,			// 附近玩家界面
};

class TeamUI : public UIBase
{
public:
	TeamUI();
	~TeamUI();
public:
	static cocos2d::Node* createNode();
	virtual bool init();
	CREATE_FUNC(TeamUI);

	Node* m_selectedNode;
	bool m_isClicked;
	vector<Sprite*> m_controlList;

	Sprite* m_myTeam;
	Node* m_myTeamPanel;
	ui::ListView* m_myTeamList;
	ui::Text* m_myTeam_Tishi;


	Sprite* m_nearbyMan;
	Node* m_nearbyManPanel;
	ui::ListView* m_nearbyList;
	ui::Text* m_nearby_Tishi;

	Sprite* m_isAllow;

	ui::ImageView* m_curSelItem;

	TeamStatusPanel m_curPanel;
	bool m_bDragView;
public:
	bool TouchDown(Touch* touch);
	void TouchMove(Touch* touch);
	bool TouchUp(Touch* touch);
	void ClickCallback(float dt);			//点击回调

	void Open();							//打开
	void Close();							//关闭
	void RefreshData();					//刷新队伍界面数据

	void ClickItem(Ref *pSender);

	void SetCurPanel(TeamStatusPanel status);
};